const app = getApp()
Page({
    /**
     * 页面的初始数据
     */
    data: {
        lng: '115.798940',
        lat: '39.257770'
    },
    markertap(e) {
        //39.257770,115.798940
        wx.openLocation({
            latitude: parseFloat(this.data.lat),
            longitude: parseFloat(this.data.lng),
            scale: 18,
            name: "九州隆泰酒店",
            address: "河北省 保定市 定兴县 昌盛大街158号"
        })
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        var that = this
        that.setData({
            markers: [{
                title: '婚礼地点',
                iconPath: "/images/nav.svg",
                id: 0,
                latitude: this.data.lat, // 页面初始化 options为页面跳转所带来的参数
                longitude: this.data.lng,
                width: 30,
                height: 30,
                anchor:{
                    x: .5, y: 1
                },
                callout: {
                    content: '婚礼就在这儿举办啊',
                    color: '#ff4c91',
                    // bgColor: 'rgba(255,255,255,.05)',
                    padding: 6,
                    // fontSize:16,
                    display: 'ALWAYS',
                    textAlign: 'center',
                    borderRadius: 6
                }
            }]
        });
    },
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
        return {
            title: app.globalData.shareData.share,
            imageUrl: app.globalData.shareData.thumb,
            path: 'pages/invitation/index',
            success: function (res) {
                wx.showToast({
                    title: '分享成功',
                })
            },
            fail: function (res) {
                // 转发失败
                wx.showToast({
                    title: '分享取消',
                })
            }
        }
    },
})
